package list;

/**
 * @Author wy
 * @Description https://www.nowcoder.com/practice/75e878df47f24fdc9dc3e400ec6058ca?tpId=295&tqId=23286&ru=/exam/oj&qru=/ta/format-top101/question-ranking&sourceUrl=%2Fexam%2Foj
 * @Date 2023/6/7 14:07
 * @Version 1.0
 */
public class List01 {


    public ListNode ReverseList(ListNode head) {

        return null;
    }

    public static void main(String[] args) {
       ListNode header=new ListNode(1);
       ListNode two=new ListNode(2);
       ListNode three=new ListNode(3);

       //1-->2
        header.next=two;
        //2-->3
        //header.next.next=three;
        two.next=three;

        show(header);

    }

    private static void show(ListNode head){
        if(head==null){
            System.out.println("空链表");
        }else{
            ListNode temp=head;
            while(temp!=null){
                System.out.print(temp.val+"\t");
                //移后移动一个
                temp=temp.next;
            }
            System.out.println();
        }
    }
}
